/**
 * Description:
 * Class Name:Person
 * Date:2022/5/2 19:49
 *
 * @author LTisme
 * @version JAVA17
 */
package 疯狂Java讲义.第15章_输入输出._15_8_Java9改进的对象序列化._15_8_5_自定义序列化;

import java.io.Serializable;

public class Person implements Serializable {
    private String name;
    private transient int age;
    // 注意此处没有提供无参数的构造器
    public Person(String name, int age){
        System.out.println("有参数的构造器");
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setName(String name) {
        this.name = name;
    }
}
